<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/cloudiary.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Cloudiary</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<script type="text/javascript" src="Js/jquery.js"></script>
<script type="text/javascript" src="Js/slider.js"></script>
<!-- InstanceEndEditable -->
<link href="CSS/css.css" rel="stylesheet" type="text/css" />
</head>
<?php
include('userlock.php');

if($_SERVER["REQUEST_METHOD"] == "POST")
{
	if(isset($_POST['Status'])){
	$mystatus=addslashes($_POST['Status']);
	$q = "UPDATE user SET user_status='$mystatus' Where user_email = '$login_session'";
	mysql_query($q);
	}
}

$query = mysql_query("SELECT * FROM user where user_email = '$login_session'");
$query = mysql_fetch_array($query);
?>
<body>
<div id="container">
<div id="wrapper">

<div id="header">
<!-- InstanceBeginEditable name="header" -->
<div class="welcome">
<?php include('welcomeuser.php'); ?>
</div>
<!-- InstanceEndEditable -->

<img src="Assets/cloud diary low-01(trans).png" alt="CloudDiary" width="75" height="45" style="padding:5px 10px;" /> <br />
</div>

<div id="main">
<!-- InstanceBeginEditable name="main" -->
<ul class="dropdown">
<li><a href="Home.php" class="linkStraight">Home &nbsp; &nbsp;</a></li>
<li><a href="#" class="linkDown" id="classification">Classifications &nbsp; &nbsp;</a>
	<ul class="sub_menu" id="menu1">
    <li> <a href="PublicClassification.php"> Public &nbsp; </a> </li>
    <li> <a href="FriendClassification.php"> Friend &nbsp; </a> </li>
    </ul>
</li>
<li><a href="#" class="linkDown" id="friends">Friends &nbsp; &nbsp;</a>
	<ul class="sub_menu" id="menu2">
    <li> <a href="Friends.php"> Search Friends &nbsp; </a> </li>
    <li> <a href="CurrentFriends.php"> Current Friends &nbsp; </a> </li>
    <li> <a href="Send.php"> Sending Request &nbsp; </a> </li>
    <li> <a href="Receive.php"> Pending Request &nbsp; </a> </li>
    </ul>
</li>
<li><a href="#" class="linkDown" id="posts">Posts &nbsp; &nbsp;</a>
	<ul class="sub_menu" id="menu3">
    <li> <a href="NewPost.php"> New Post &nbsp; </a> </li>
    <li> <a href="ViewPosts.php">  View All Posts &nbsp; </a> </li>
    </ul>
</li>
<li><a href="Privacy.php" class="linkStraight">Privacy Settings &nbsp; &nbsp;</a></li>
</ul>

<div id="content">
<table border="0" width="100%">
    <tr>
    <td colspan="3">&nbsp;  </td> 
    </tr>
    
    <tr> <td rowspan="6" width="20px"> &nbsp; </td>
	<td width="150px" align="center" rowspan="6">
    <img src="display_photo.php?id=<?php echo $query['user_email']; ?>" width="150px" height="170px" style="border:solid 1px #69F; padding:2px;" />
    </td>
	<td width="20px" style="border-right:1px solid #69F" rowspan="6"> &nbsp; </td>
	<td height="30px" style="padding-left:10px">
	<form method="POST">
    <p> Status: <input type="text" name="Status"  <?php if(empty($query['user_status'])) {echo "placeholder='What do you think ?'";} else { echo "value='".$query['user_status']."'"; } ?> size="50" />  
	&nbsp; <input type="image" src="Assets/buttonUpdate.png" onClick="window.location.href=window.location.href" /> </p>
	</form>
	</td>
	</tr>
	
	<tr> <td height="10px" style="padding-left:10px" id="particular"> <label> <span> Name </span> : &nbsp; <?php echo $query['user_name']; ?> </label> </td> </tr>
	<tr> <td height="10px" style="padding-left:10px" id="particular"> <label> <span> Gender </span> : &nbsp; <?php echo $query['user_gender']; ?> </label> </td> </tr>
	<tr> <td height="10px" style="padding-left:10px" id="particular"> <label> <span> Date of Birth </span> : &nbsp; <?php echo $query['user_dob']; ?> </label> </td> </tr>
	<tr> <td height="10px" style="padding-left:10px" id="particular"> <label> <span> Country </span> : &nbsp; <?php echo $query['user_country']; ?> </label> </td> </tr>
	<tr> <td height="10px" style="padding-left:10px" id="particular"> <label> <span> Join Date </span> : &nbsp; <?php echo $query['user_join']; ?> </label> </td> </tr>
	
    <tr> <td colspan="4"  style="border-bottom:solid 1px #69F;">&nbsp;  </td> </tr>
    </table>
    <br />
    <table border="0" width="100%">
    <tr>
    <td width="32" rowspan="3">&nbsp;  </td>
    <td colspan="6">&nbsp;  </td> 
    <td width="32" rowspan="3">&nbsp;  </td>
    </tr>
    <?php 
	$q = "SELECT u.user_name,u.user_email,p.post_topic,p.post,p.post_date,p.post_time,p.post_edit_date,p.post_edit_time,p.privacy_type,p.post_ID FROM post p INNER JOIN friend f ON p.user_email = f.friend_email INNER JOIN user u ON p.user_email = u.user_email WHERE f.user_email='$login_session' AND p.privacy_type != 'private to self' ORDER BY p.post_date DESC";
	$q = mysql_query($q);
	while($data_fetch=mysql_fetch_array($q))
    {
		echo "<tr> <td width='90' rowspan='2'>";
		echo "<img src='display_photo.php?id=".$data_fetch['user_email']."' width='90px' height='100px' style='border:solid 1px #69F; padding:2px;' />";
		echo "</td>";
		echo "<td height='76' colspan='5' style='padding-left:8px' > Topic ".$data_fetch['post_topic']."<br />";
		echo "".substr($data_fetch['post'], 0, 300)." <br /> <br /><a href='FriendPost.php?id=".$data_fetch['post_ID']."'> Read More &raquo; </a> </td>";			
		echo"</tr>";
		echo"<tr>"; 
		echo"<td height='22' align='center' style='color:#999; font-size:11px'> &nbsp; Posted Date ".$data_fetch['post_date']."</td>";
		echo"<td height='22' align='center' style='color:#999; font-size:11px'> &nbsp; Posted Time ".$data_fetch['post_time']."</td>";
		echo"<td height='22' align='center' style='color:#999; font-size:11px'> &nbsp; Last Update Date ".$data_fetch['post_edit_date']."</td>";
		echo"<td height='22' align='center' style='color:#999; font-size:11px'> &nbsp; Last Update Time ".$data_fetch['post_edit_time']."</td>";
		echo"<td align='center' height='22' style='color:#999; font-size:11px'> Posted by ".$data_fetch['user_name']." </td>";
		echo"</tr>";
		echo"<tr> <td colspan='8'  style='border-bottom:solid 1px #69F;'>&nbsp;  </td> </tr>";
	}
	?>
    </table>
</div>
<!-- InstanceEndEditable -->
</div>

</div>
</div>

<div id="footer">
<p align="center"> &copy; &nbsp; 2012 CloudDiary </p>
</div>
</body>
<!-- InstanceEnd --></html>